package com.charonmc.utils;

import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;

public class PapiUtils extends PlaceholderExpansion {
    @Override
    public boolean canRegister(){
        return true;
    }
    @Override
    public String getAuthor(){
        return "CharonMC";
    }
    @Override
    public String getIdentifier(){
        return "Charon";
    }
    @Override
    public String getVersion(){
        return "1.0.0";
    }

    @Override
    public String onRequest(OfflinePlayer player, String identifier){
        if(identifier.equals("Prefix")){
            return PrefixUtils.getPlayerPrefix(Bukkit.getPlayer(player.getName()));
        } else if (identifier.equals("Prefix_Tiny")){
            return PrefixUtils.getPlayerPrefixTiny(Bukkit.getPlayer(player.getName()));
        }
        return null;
    }
}